#include "windowwrapper.h"

WindowWrapper::WindowWrapper(QWidget* parent) : QObject(parent)
{

}

void WindowWrapper::close()
{
    QWidget* widget = qobject_cast<QWidget*>(this->parent());
    if(widget) {
        widget->close();
    }
}

void WindowWrapper::minimize()
{
#ifdef Q_WS_MAEMO_5
    QDBusConnection conn = QDBusConnection::sessionBus();
    QDBusMessage msg = QDBusMessage::createSignal("/",
                                                  "com.nokia.hildon_desktop",
                                                  "exit_app_view");
    conn.send(msg);
#else
    QWidget* widget = qobject_cast<QWidget*>(this->parent());
    if(widget) {
        widget->setWindowState(Qt::WindowMinimized);
    }
#endif
}
